<%@page import="com.carrental.service.CarListService"%>
<%@page import="com.carrental.entity.CarList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改汽车</title>
<style>
	*{
		margin: 0;
		padding: 0;
	}
	
	html,body{
		width: 100%;
		height: 100%;
		background-color: #f2f2f2;
	}
	
	.head{
		width: 100%;
		height: 50px;
		line-height: 50px;
		background-color: #FA8258;
		color: #ffffff;
	}
	.head-content{
		width: 900px;
		margin: auto;
	}
	.head-content h2{
		float: left;
		margin-right: 10px;
	}
	.head-content a{
		float: left;
		margin-right: 10px;
	}
	.main{
		width: 100%;
	}
	.main-content{
		padding: 20px;
		width: 900px;
		margin: auto;
		background: #ffffff;
	}
	
	
	table{
		width: 50%;
		text-align: center;
	}
	table tr{
		height: 50px;
	}
	
	.select-button{
		width: 100px;
		height: 30px;
	}
</style>
</head>
<body>
	<%
		String id = request.getParameter("id");
		CarListService carListService = new CarListService();
		CarList carList = carListService.selectById(id);
	%>
	<div class="head">
		<div class="head-content">
			<h2>汽车租赁网后台管理</h2>
			<a href="admin.jsp">首页</a>
			<a href="adminCarRentalList.jsp">订单管理</a>
			<a href="adminUserList.jsp">用户管理</a>
			<a href="LogoutServlet">退出</a>
		</div>
	</div>
	<div class="main">
		<div class="main-content">
			<form action="CarListUpdateServlet" method="post">
				<h2>修改汽车</h2>
				<table>
					<tr>
						<td>编号</td>
						<td>
							<input name="id" type="text" readonly="readonly" value="<%=carList.getId()%>">
						</td>
					</tr>
					<tr>
						<td>型号</td>
						<td>
							<input name="model" type="text" value="<%=carList.getModel()%>">
						</td>
					</tr>
					<tr>
						<td>数量</td>
						<td>
							<input name="number" type="number" value="<%=carList.getNumber()%>">
						</td>
					</tr>
					<tr>
						<td>单价</td>
						<td>
							<input name="price" type="text" value="<%=carList.getPrice()%>">
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<button class="select-button">修改</button>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>